$(function () {
    // $.ajax({
    //     url:"goods",
    //     type:"post",
    //     data:{"method":"goods"},
    //     dataType:"json",
    //     success:function (data) {
    //         var msg="";
    //         $.each(data, function (index,k) {
    //             //alert("index:"+index+"k:"+k);
    //             msg+="<div class='list clearfix transition'>";
    //             msg+="<div class='tu clearfix'>";
    //             msg+="<img src='goods/"+k.goodsPic+"'/>";
    //             msg+="<span></span>";
    //             msg+="<div class='ycang clearfix'>";
    //             msg+="<samp class='opa8'></samp>";
    //             msg+="<div class='nr clearfix'>";
    //             <!--注意：当下方li中添加class名为cur的时候为选中的时候样式-->
    //             msg+="<ul>";
    //             msg+="<li class='box-s transition'>收藏</li>";
    //             msg+="<li class='box-s transition'>购物车</li>";
    //             msg+="</ul>";
    //             msg+="</div>";
    //             msg+="</div>";
    //             msg+="</div>";
    //             msg+="<div class='xia clearfix box-s'>";
    //             msg+="<p class='bt over'>"+k.goodsName+"</p>";
    //             msg+="<div class='price clearfix'>";
    //             msg+="<span class='fl'>￥"+k.goodsNewPrice+"</span>";
    //             msg+="<a href='pro_detail.jsp'   tppabs='http://localhost:8080/ProjectTwo_war_exploded/pro_detail.jsp' class='goumai fr ra3 transition'>立即购买</a>";
    //             msg+="</div>";
    //             msg+="</div>";
    //             msg+="</div>";
    //         });
    //         $("#mybody").html(msg);
    //     }
    // });

    $.ajax({
        url:"artist",
        type:"post",
        data:{"method":"art"},
        dataType:"json",
        success:function (data) {
            var msg="";
            $.each(data,function (index,k) {
                msg+="<li>";
                msg+="<div class='list clearfix fl box-s transition'>";
                msg+="<div class='tu clearfix box-s'>";
                msg+="<img src='headp/"+k.a_headp+"'/>";
                msg+="<span></span>";
                msg+="</div>";
                msg+="<div class='ctent clearfix box-s'>";
                msg+= "<div class='shang clearfix'>";
                msg+="<p class='over ta-center'>"+k.a_truename+"</p>";
                msg+="<span></span>";
                msg+="</div>";
                msg+="<div class='xia clearfix'>";
                msg+="<p><a href='#' class='more'>"+k.a_intro+"查看更多&gt;&gt;</a></p>";
                msg+="</div>";
                msg+="</div>";
                msg+="</div>";
                msg+="</li>";
            });

            $("#myfrom").html(msg);
        }
    });
    // $("#onee").click(function () {
    //     window.location.href="pro_detail.jsp";
    // });
    // $.ajax({
    //     url:"recommends",
    //     type:"post",
    //     data:{"method":"rec"},
    //     dataType:"json",
    //     success:function (data) {
    //         var msg="";
    //         $.each(data,function (index,k) {
    //             msg+="<li>";
    //             msg+="<div class='listone clearfix fl'>";
    //             msg+="<a href='#'>";
    //             msg+="<div class='tu clearfix'>";
    //             msg+="<img src='img/"+k.rpic+"'/>";
    //             msg+="<span></span>";
    //             msg+="</div>";
    //             msg+="<div class='listxia clearfix ta-center'>";
    //             msg+="<h2>";
    //             msg+="<p>"+k.rnaeme;
    //             msg+="<span>"+k.pprice+"</span></p>";
    //             msg+="</h2>";
    //             msg+="</div>";
    //             msg+="</a>";
    //             msg+="</div>";
    //             msg+="</li>";
    //         });
    //         $("#mytable").html(msg);
    //     }
    // });

    //专场
    $.ajax({
        url:"goods",
        type:"post",
        data:{"method":"goods","page":1,"rows":5},
        dataType:"json",
        success:function (data) {
            var msg="";
            $.each(data.list, function (index,k) {

                //alert("index:"+index+"k:"+k);
                msg+="<div class='list clearfix transition'>";
                msg+="<div class='tu clearfix'>";
                msg+="<img src='"+k.goodsPic+"' tppabs='http://demo.mxyhn.xyz:8020/cssthemes6/1.27ZF11/upload/2.jpg'/>";
                msg+="<span></span>";
                msg+="<div class='ycang clearfix'>";
                msg+="<samp class='opa8'></samp>";
                msg+="<div class='nr clearfix'>";
                msg+="<ul>";
                msg+="<li class='box-s transition'>关注</li>";
                msg+="<li class='box-s transition'>购物车</li>";
                msg+="</ul>";
                msg+="</div>";
                msg+="</div>";
                msg+="</div>";
                msg+="<div class='xia clearfix box-s'>";
                msg+="<p class='bt over'>"+k.goodsName+"</p>";
                msg+="<div class='price clearfix'>";
                msg+="<span class='fl'>￥"+k.goodsNewPrice+"<samp>原价￥"+k.goodsOldPrice+"</samp></span>";
                msg+="<a href='pro_detail.jsp' tppabs='http://demo.mxyhn.xyz:8020/cssthemes6/1.27ZF11/pro_detail.html' class='goumai fr ra3 transition'>立即购买</a>";
                msg+="</div>";
                msg+="</div>";
                msg+="</div>";
            });
            $("#mytab").html(msg);
            //分页
            // pageMe.js 使用方法
            $("#page").paging({
                pageNum:data.pageNum, // 当前页面
                totalNum: data.maxPage, // 总页码
                totalList: data.count, // 记录总数量
                callback: function (num) { //回调函数
                    $.ajax({
                        url: "goods",
                        type: "post",
                        data: {"method": "goods", "page": num, "rows": 5},
                        dataType: "json",
                        success:function (data) {
                            var msg = "";
                            $.each(data.list, function (index, k) {
                                //alert("index:"+index+"k:"+k);
                                msg += "<div class='list clearfix transition'>";
                                msg += "<div class='tu clearfix'>";
                                msg += "<img src='" + k.goodsPic + "' tppabs='http://demo.mxyhn.xyz:8020/cssthemes6/1.27ZF11/upload/2.jpg'/>";
                                msg += "<span></span>";
                                msg += "<div class='ycang clearfix'>";
                                msg += "<samp class='opa8'></samp>";
                                msg += "<div class='nr clearfix'>";
                                msg += "<ul>";
                                msg += "<li class='box-s transition'>关注</li>";
                                msg += "<li class='box-s transition'>购物车</li>";
                                msg += "</ul>";
                                msg += "</div>";
                                msg += "</div>";
                                msg += "</div>";
                                msg += "<div class='xia clearfix box-s'>";
                                msg += "<p class='bt over'>" + k.goodsName + "</p>";
                                msg += "<div class='price clearfix'>";
                                msg += "<span class='fl'>￥" + k.goodsNewPrice + "<samp>原价￥" + k.goodsOldPrice + "</samp></span>";
                                msg += "<a href='pro_detail.jsp' tppabs='http://demo.mxyhn.xyz:8020/cssthemes6/1.27ZF11/pro_detail.html' class='goumai fr ra3 transition'>立即购买</a>";
                                msg += "</div>";
                                msg += "</div>";
                                msg += "</div>";
                            });
                            $("#mytab").html(msg);
                        }
                    });
                }
            });
        }
    });

});